package com.whatech.mall.user.controller;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.whatech.mall.user.model.dto.UserDTO;
import lombok.extern.slf4j.Slf4j;

/**
 * UserController的限流处理类。
 */
@Slf4j
public class UserControllerBlockHandlerClass {

    /**
     * 查询用户列表的接口降级处理
     */
    public static UserDTO listBlockHandler(Long id, BlockException e) {
        log.warn("UserController.list() fallback.", e);
        UserDTO userDTO = new UserDTO();
        userDTO.setId(id);
        return userDTO;
    }

}
